import java.util.Scanner;

public class Questions {
    public static void main(String[] args) {
        System.out.println("Hello World");
    }
    //斐波那契
    public static int func5(int n) {
        if(n == 1 || n == 2){
            return 1;
        }
        return func4(n-1) + func4(n-2);
    }
    //求1到n的和
    public static int func4(int n) {
        if(n == 1){
            return 1;
        }
        return n+func4(n-1);
    }
    public static int func3(int n){
        //将一个数字的每一位相加
        if(n<10){
            System.out.println(n);
        }
        return n%10 + func3(n/10);
    }

    //递归 - 拿到一个数字的每一位
    public static void func2(int n){
        if(n<10){
            System.out.println(n);
            return;
        }
       func2(n/10);
        System.out.println(n%10);
    }

    //递归 - 阶乘
    public static int func1(int n) {
        if(n == 1){
            return 1;
        }
        return n*func1(n-1);
    }
    public static void main13(String[] args) {
        //斐波那契额数列求第n项的和
        int f1 = 1;
        int f2 = 1;
        int f3 = 1;
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        for (int i = 3; i <= n; i++) {
            f3 = f1 + f2;
            f1 = f2;
            f2 = f3;
        }
        System.out.println(f3);
    }
    private static int gcd(int a, int b) {
        int t;
        while(b!=0) {
            t=b;
            b=a%b;
            a=t;
        }
        return a;
    }

    public static void main12(String[] args) {
        //最小公倍数
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            System.out.println((n*m)/gcd(n,m));
        }
    }
    public static void main11(String[] args) {
        //最大公约数
        int a = 24;
        int b = 18;
        int c = a % b;
        while(c != 0){
            a = b;
            b = c;
            c = a % b;
        }
        System.out.println(c);
    }
    public static void main10(String[] args) {
        //判断素数
        for (int n = 1; n < 100; n++) {
            //int n = 7;
            int i = 2;
            for (; i < Math.sqrt(n); i++) {//sqrt(n) - 开平方
                if (n % i == 0) {
                    //System.out.println(n+"不是素数");
                    break;
                }
            }
            if (i > Math.sqrt(n)) {
                System.out.println(n + "是素数");
            }
        }
    }
    public static void main9(String[] args) {
        //得到二进制的偶数位跟奇数位
        int n = 7;
        System.out.print("偶数位:");
        for (int i = 31; i >= 1; i -= 2) {
            System.out.print((n>>i & 1)+" ");
        }
        System.out.println();
        System.out.print("奇数位:");
        for (int i = 30; i >= 0; i -= 2) {
            System.out.print((n>>i & 1)+" ");
        }
    }

public static void main8(String[] args) {
    //密码登录系统
    int count = 3;
    Scanner scanner = new Scanner(System.in);
    while(count != 0){
        System.out.println("请输入密码，有"+count+"次机会");
        String code = scanner.nextLine();
        //if(code == "123"){
        if (code.equals("123")){//equals - 比较字符串大小
            System.out.println("密码正确");
            break;
        }else {
            System.out.println("密码错误");
        }
        count--;
    }
}
public static void main7(String[] args) {
    //乘法口诀表
    for (int i = 1; i <= 9; i++) {
        for (int j = 1; j <= i; j++) {
            System.out.print(i + "*" + j + "=" + i * j + " ");
        }
        System.out.println();
    }
}
public static void main6(String[] args){
    //打印❌
    Scanner scanner = new Scanner(System.in);
    while(scanner.hasNextInt()){
        int n = scanner.nextInt();
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if(i == j || i+j == n-1){
                    System.out.print("*");
                } else{
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }
}
public static void main5(String[] args) {
    //求水仙花数
    for (int i = 0; i < 999999; i++) {
        int tmp = i,sum = 0,count = 0;
        while(tmp != 0){
            tmp /= 10;
            count++;
        }
        //计算有几位数
        tmp = i;
        while(tmp != 0){
            sum += Math.pow(tmp%10,count);
            tmp /= 10;//减一位
        }
        if(sum == i){
            System.out.println(sum);
        }
    }
}
public static void main4(String[] args) {
    //计算1-1/2+1/3......+1/99-1/100
    double sum = 0.0;
    int flag = 1;
    for (int i = 1; i <= 100; i++) {
        sum += 1.0/i * flag;
        flag = -flag;
    }
    System.out.println(sum);
}
//法三
public static void main3(String[] args) {
    int n = 7, count = 0;
    while(n != 0){
        n = n & (n-1);
        count++;
    }
    System.out.println(count);
}
//法二
public static void main2(String[] args) {
    int n = -1,count = 0;
    while(n != 0){
        if((n & 1) != 0){
            count++;
        }
        n = n >>> 1;
    }
}
public static void main1(String[] args) {
    //求二进制中1的个数 - 法一
    Scanner scan=new Scanner(System.in);
    int n=scan.nextInt();
    int count = 0;
    for (int i = 0; i < 32; i++) {
        if ((n >> i & 1) == 1){
            count++;
        }
        System.out.println(count);
    }
}
}
